package com.codetci.rabbitmq;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author: zhenzhong.wang@honeywell.com
 * @date: 2019/10/14 3:12 PM
 */
@Component
public class TestController {

  @Autowired
  RabbitTemplate rabbitTemplate;

  @PostConstruct
  public void test() {
    rabbitTemplate.send("directExchange", "test.queue1", new Message("test message".getBytes(), new MessageProperties()));
//    rabbitTemplate.send("directExchange", "test.queue2", new Message("test message".getBytes(), new MessageProperties()));


//    rabbitTemplate.send("topicExchange", "test.user sfs", new Message("test message".getBytes(), new MessageProperties()));

//    rabbitTemplate.send("fanoutExchange", "", new Message("test message".getBytes(), new MessageProperties()));



  }
}
